<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Document</title>
</head>
<!-- rowspan纵向合并单元格
clospan横向合并单元格 -->
<style>
    table {
        width: 50%;
        border: 1px solid black;
        /* border-spacing: 10px; 边框之间的距离*/
        /* border-collapse: collapse;设置边框的合并 */
        margin: 0 auto;
    }
    td{
        border: 1px solid black;
        vertical-align: middle;
        text-align: center;
    }
    tr:nth-child(2n+1){
        background-color: chartreuse;
    }
</style>

<body>
    <table>
        <thead>
            <tr>
                <td>班级</td>
                <td>年龄</td>
                <td>性别</td>
                <td>收入</td>
            </tr>
        </thead>
        <tbody></tbody>
        <tr>
            <td>2</td>
            <td>12</td>
            <td>男</td>
            <td>1000</td>
        </tr>
        <tr>
            <td>1</td>
            <td>13</td>
            <td>男</td>
            <td>1000</td>
        </tr>
        <tr>
            <td>2</td>
            <td>12</td>
            <td>男</td>
            <td>1000</td>
        </tr>

        <tfoot>
            <tr>
                <td></td>
                <td></td>
                <td></td>
                <td>合计</td>
            </tr>
        </tfoot>

    </table>
</body>

</html>